<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.lmpop.trade.ti_emailtem.*" %>
<%@ page import="java.util.*" %>
<% 
  	String tem_id="";	
	String user_id="";
	if( session.getAttribute("session_user_id") != null ){
		user_id = session.getAttribute("session_user_id").toString();
	}
	
  	if(request.getParameter("tem_id")!=null) tem_id = request.getParameter("tem_id");
  	Ti_emailtemInfo ti_emailtemInfo = new Ti_emailtemInfo();
  	List list = ti_emailtemInfo.getListByPk(tem_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",tem_type="",tem_name="",content="",in_date="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("tem_type")!=null) tem_type = map.get("tem_type").toString();
  	if(map.get("tem_name")!=null) tem_name = map.get("tem_name").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
	
	String s_tem_name = "";
	if(request.getParameter("search_tem_name")!=null && !request.getParameter("search_tem_name").equals("")){
		s_tem_name = request.getParameter("search_tem_name");
	}
	String s_tem_type = "";
	if(request.getParameter("search_tem_type")!=null && !request.getParameter("search_tem_type").equals("")){
		s_tem_type = request.getParameter("search_tem_type");
	}	
	String end_date = "";
	if(request.getParameter("txtEndDate")!=null && !request.getParameter("txtEndDate").equals("")){
		end_date = request.getParameter("txtEndDate");
	}	
	String start_date = "";
	if(request.getParameter("txtStartDate")!=null && !request.getParameter("txtStartDate").equals("")){
		start_date = request.getParameter("txtStartDate");
	}	
	
	String s_cust_name = "";
	if(request.getParameter("search_cust_name")!=null && !request.getParameter("search_cust_name").equals("")){
		s_cust_name = request.getParameter("search_cust_name");
	}

	String url = "/program/admin/comemailtem";
%>

<html>
  <head>
    
    <title>邮件模板管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/program/admin/emailtem/js_emailtem.js" ></script>

</head>

<body>

  
	
	<h1>修改邮件模板</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
		<table width="100%" class="listtab" cellpadding="1" cellspacing="1" border="0">
		<input name="user_id" id="user_id" type="hidden" value="<%=user_id%>" />
	<input name="cust_id" id="cust_id" type="hidden" value="<%=cust_id%>" />
	<input name="in_date" id="in_date" type="hidden" value="<%=in_date%>" />		
				
		<tr>
			<td align="right" width="10%">
				模板名称<font color="red">*</font>
			</td>
			<td>
			<input name="tem_name" id="tem_name" type="text" value="<%=tem_name %>" maxlength="200" size="25"/>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				模板类型:
			</td>
			<td>
			<input type="radio" name="tem_type" id="tem_type" value="1" <%if(tem_type.equals("1")){out.print("checked");}%> /> 业务模板 &nbsp;
			<input type="radio" name="tem_type" id="tem_type" value="0" <%if(tem_type.equals("0")){out.print("checked");}%> />   系统模板
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				模板内容<font color="red">*</font>
			</td>
			<td>
			<textarea name="content" ><%=content %></textarea>
			<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
			<script type="text/javascript">
				CKEDITOR.replace('content');
			</script>
			</td>
		</tr>

	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="6200" />
	  			<input type="hidden" name="tem_id" value="<%=tem_id %>" />
				<input type="submit" class="buttoncss" name="tradeSub" onclick="return submitForm()"  value="提交" />&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='<%=url%>';"/>
				<input type="hidden" name="jumpurl" value="<%=url%>" />
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
